/*
 * brv_flash.h
 *
 *  Created on: 2025年4月8日
 *      Author: 22332
 */
#ifndef DRV_FLASH_H_
#define DRV_FLASH_H_

#include "sdk_project_config.h"

#define FTFx_DPHRASE_SIZE  				 0x0010U
#define BUFFER_SIZE        				 48U          		/* Size of data source */
#define WRITE_BUFFER_SIZE_UPDATA         2048U              /* Size of data source */
#define EFM_SECTOR_VENDOR_A_DATA_NUM     (31U)   			// 诊断数据存储区
#define EFM_SECTOR_VENDOR_B_DATA_NUM     (28U)   			// 诊断数据存储区
#define SECTOR_SIZE                      (0x400UL)
#define SECTOR_ADDR(x)                   (uint32_t)(SECTOR_SIZE * (x))

extern void bsp_drv_flash_init(void);
extern void bsp_drv_flash_write(uint32_t address,uint8_t * write_buffer,int length);
extern uint16_t bsp_drv_flash_read_byte(volatile uint8_t * flashPtr,uint8_t *buffer, uint32_t length);
#if 0
extern uint16_t bsp_drv_get_A_part_vendor_data(uint8_t *buffer, uint32_t length);
extern uint16_t bsp_drv_get_B_part_vendor_data(uint8_t *buffer, uint32_t length);
#endif
#endif /* DRV_FLASH_H_ */
